// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_imgex.p_a;

import android.content.Context;
import android.graphics.PointF;
import android.os.Handler;
import android.util.FloatMath;
import android.view.MotionEvent;

import com.nnee.p_imgex.cls_ImageViewTouch;

// Referenced classes of package com.nnee.p_imgex.a:
//            a, e, b

public class cls_c
{

    public cls_c(Context context, cls_ImageViewTouch imageviewtouch)
    {
        d = 0;
        e = new PointF();
        f = new PointF();
        g = 1F;
        h = 0F;
        i = imageviewtouch;
        j = new Handler();
    }

    static cls_ImageViewTouch a(cls_c c1)
    {
        return c1.i;
    }

    private void a(PointF pointf, cls_a a1)
    {
        float f1 = a1.a(0) + a1.a(1);
        float f2 = a1.b(0) + a1.b(1);
        pointf.set(f1 / 2F, f2 / 2F);
    }

    private void a(cls_a a1)
    {
        e.set(a1.c(), a1.d());
        d = 1;
        h = 0F;
    }

    static PointF b(cls_c c1)
    {
        return c1.f;
    }

    private void b(cls_a a1)
    {
        g = d(a1);
        if(g > 10F)
        {
            a(f, a1);
            d = 2;
        }
    }

    static cls_b c(cls_c c1)
    {
        return c1.k;
    }

    private void c(cls_a a1)
    {
        if(d != 1) {
        	if(d == 2)
            {
                float f1 = d(a1);
                if(f1 > 10F)
                {
                    float f2 = f1 / g;
                    h = f2;
                    j.post(new cls_e(this, f2));
                }
                g = f1;
            }
        } else {
        	 i.a_(a1.c() - e.x, a1.d() - e.y);
             e.set(a1.c(), a1.d());
        }

    }

    private float d(cls_a a1)
    {
        float f1 = a1.a(0) - a1.a(1);
        float f2 = a1.b(0) - a1.b(1);
        return FloatMath.sqrt(f1 * f1 + f2 * f2);
    }

    public void a()
    {
        i = null;
        j = null;
    }

    public void a(cls_b b1)
    {
        k = b1;
    }

    public boolean a(MotionEvent motionevent)
    {
        cls_a a1;
        int l;
        a1 = com.nnee.p_imgex.p_a.cls_a.a(motionevent);
        l = a1.b();
        com.nnee.p_g.cls_b.c("onMultiTouchEvent", (new StringBuilder()).append("onMultiTouchEvent: ").append(l).toString());
        if(l != 0) {
        	if(l == cls_a.c)
                b(a1);
            else
            if(l == 1 || l == com.nnee.p_imgex.p_a.cls_a.b || l == 3)
                d = 0;
            else
            if(l == 2)
                c(a1);
        } else{
        	 a(a1);
        }

        return true;

    }

    private static final int a = 0;
    private static final int b = 1;
    private static final int c = 2;
    private int d;
    private PointF e;
    private PointF f;
    private float g;
    private float h;
    private cls_ImageViewTouch i;
    private Handler j;
    private cls_b k;
}
